package com.kikcn.demo.domain;

import org.hibernate.validator.constraints.NotBlank;

import javax.persistence.*;
import java.io.Serializable;

/**
 * User: wlai
 * Date: 4/10/15
 * Time: 9:58 AM
 */

@MappedSuperclass
@Inheritance(strategy= InheritanceType.TABLE_PER_CLASS)
public class BookmarkBase extends Base implements Serializable{

    @Column
    @NotBlank(message = "name can not be blank")
    private String name;


    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @ManyToOne
    @JoinColumn(name = "FOLDER_ID",nullable = true)
    private BookmarkFolder parent;

    public BookmarkFolder getParent() {
        return parent;
    }

    public void setParent(BookmarkFolder parent) {
        this.parent = parent;
    }
}


